package com.application.common;

import java.util.Collection;
import java.util.Map;

public class EmptyChecker {

	public static boolean isEmpty(Object object){
		if(null == object|| "null".equals(object.toString())||"".equals(object.toString())){
			return true;
		}
		
		if(object instanceof String){
			return 0 == ((String) object).trim().length();
		}
		
		if(object instanceof Collection){
			return ((Collection<?>) object).isEmpty();
		}

		if(object instanceof Map){
			return ((Map<?,?>) object).isEmpty();
		}
		
		return false;
	}
	public static boolean isEmpty(Object[] object){
		if(null == object|| 0==object.length){
			return true;
		}

		return false;
	}	
	public static boolean notEmpty(Object object){
		return !isEmpty(object);
	}
}
